package com.longcai.piaojia.activity;

import android.Manifest;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.longcai.piaojia.BaseApplication;
import com.longcai.piaojia.R;
import com.longcai.piaojia.dialog.WarnningDialog;
import com.longcai.piaojia.util.UtilPermission;
import com.zcx.helper.bound.BoundView;
import com.zcx.helper.util.UtilApp;

/**
 * Created by Administrator on 2016/8/22.
 */
public class MyAboutUsActivity extends BaseActivity implements View.OnClickListener{

    @BoundView(R.id.about_us_service_version_tv) private TextView about_us_service_version_tv;
    @BoundView(R.id.about_us_service_tel_tv) private TextView about_us_service_tel_tv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_about_us);

        String[] permission = { Manifest.permission.CALL_PHONE};
        UtilPermission.Permission(this, permission);

        setBackTrue();

        setTitleName(getString(R.string.about_us_title_text));

        about_us_service_version_tv.setText(UtilApp.versionName(this) + getResources().getString(R.string.space) + getResources().getString(R.string.about_us_version_text));

        about_us_service_tel_tv.setText(BaseApplication.BasePreferences.readCustomServiceTel());

        about_us_service_tel_tv.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {

        switch (v.getId()) {

            case R.id.about_us_service_tel_tv:

                new WarnningDialog(context, about_us_service_tel_tv.getText().toString(), getString(R.string.cancel_text), getString(R.string.confirm_text)) {
                    @Override
                    protected void onConfirm() {

                        UtilApp.call(context, about_us_service_tel_tv.getText().toString());

                    }
                }.show();

                break;
        }
    }



}
